/*
 * memtest.c
 */
#include "types.h"
#include "stat.h"
#include "user.h"

int main(int argc, char *argv[]) {
	int cid, i, j;

	for (cid = 1; cid <= 10; cid++) {
		if (fork() == 0) {
			//child
			for (i=0; i<1000; i++) {
				if (cid % 2 == 0) {
					malloc(10);
				}
				for (j=0; j<10; j++) {
					uptime();
				}
			}
			//don't fork again, you're a child:
			printf(2, "Child %d finished\n", cid);
			break;
		}
	}
	for (cid = 1; cid <= 10; cid++) {
		wait();
	}
	exit();
}

